<script setup lang="ts">
import { ref } from 'vue'
import axios from 'axios'
import type { StudentInfo } from '@/types/StudentType.ts'
const absentList = ref<Array<StudentInfo>>([])
const searchValue = ref({
  absentStatus: 1,
})

const getAbsentList = async () => {
  const res = await axios.post('/api/student/list/page', searchValue.value)
  if (res.data.code === 0) {
    absentList.value = res.data.data?.records
  }
  console.log(absentList.value)
}

getAbsentList()
</script>

<template>
  <div class="absent">
    <el-card>
      <div class="title">请假人名单</div>
      <div class="absentList" v-for="(item, index) in absentList" :key="index">
        <div class="name">{{ item?.name }}</div>
        <div class="status">
          <el-tag type="danger">未销假</el-tag>
        </div>
      </div>
    </el-card>
  </div>
</template>

<style scoped lang="scss">
.absent {
  text-align: center;
  margin-bottom: 10px;
  width: auto;
  .title {
    margin-bottom: 15px;
  }
  .absentList {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
    padding: 10px;
  }
}
</style>
